import request from '@/utils/request'

// 查询设备离线任务列表
export function listDeviceOfflineTask(query) {
  return request({
    url: '/device/deviceOfflineTask/list',
    method: 'get',
    params: query
  })
}

// 查询设备离线任务详细
export function getDeviceOfflineTask(id) {
  return request({
    url: '/device/deviceOfflineTask/' + id,
    method: 'get'
  })
}

// 新增设备离线任务
export function addDeviceOfflineTask(data) {
  return request({
    url: '/device/deviceOfflineTask',
    method: 'post',
    data: data
  })
}

// 修改设备离线任务
export function updateDeviceOfflineTask(data) {
  return request({
    url: '/device/deviceOfflineTask',
    method: 'put',
    data: data
  })
}

// 删除设备离线任务
export function delDeviceOfflineTask(id) {
  return request({
    url: '/device/deviceOfflineTask/' + id,
    method: 'delete'
  })
}

//配置任务
export function offlineTaskConfig(deviceId) {
  return request({
    url: `/device/device/offlineTaskConfig/${deviceId}`,
    method: 'get'
  })
}